package com.crr.service.impl;

import com.crr.bean.ProductHistory;
import com.crr.common.crud.BaseServiceImpl;
import com.crr.mapper.ProductHistoryMapper;
import com.crr.service.ProductHistoryService;
import org.springframework.stereotype.Service;

@Service
public class ProductHistoryServiceImpl extends BaseServiceImpl<ProductHistory, ProductHistoryMapper> implements ProductHistoryService {
    @Override
    public int update(ProductHistory entity) {
        ProductHistory bean = baseMapper.queryByName(entity.getName());
        if(null==bean){
           return  baseMapper.save(entity);
        }else {
            return super.update(entity);
        }
    }
}
